package com.fr.report.web.ui.impl.write;

import com.fr.base.Inter;
import com.fr.base.xml.XMLPrintWriter;
import com.fr.base.xml.XMLableReader;
import com.fr.report.web.ui.Icon;
import com.fr.report.web.ui.IconManager;
import com.fr.report.web.ui.ToolBarButton;
import com.fr.report.web.ui.WebContentUtils;
import com.fr.web.Repository;

public class AppendColumnRow extends ToolBarButton
{
  private int count = 1;

  public AppendColumnRow()
  {
    super(Inter.getLocText("Add") + Inter.getLocText("Record"), IconManager.APPENDCOLUMN.getName());
  }

  public int getCount()
  {
    return this.count;
  }

  public void setCount(int paramInt)
  {
    this.count = paramInt;
  }

  protected String clickAction(Repository paramRepository)
  {
    return WebContentUtils.getContentPanel(paramRepository) + ".appendReportRC(" + this.count + ")";
  }

  public void writeXML(XMLPrintWriter paramXMLPrintWriter)
  {
    super.writeXML(paramXMLPrintWriter);
    if (this.count == 1)
      return;
    paramXMLPrintWriter.startTAG("Count").textNode(String.valueOf(this.count)).end();
  }

  public void readXML(XMLableReader paramXMLableReader)
  {
    super.readXML(paramXMLableReader);
    if (paramXMLableReader.isChildNode())
    {
      String str1 = paramXMLableReader.getTagName();
      if (str1.equals("Count"))
      {
        String str2;
        if ((str2 = paramXMLableReader.getElementValue()) != null)
          setCount(Integer.valueOf(str2).intValue());
      }
    }
  }
}